package com.dingding.queue.queue.intital;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;

import com.dingding.queue.queue.consumer.AppointSpecialOrderConsumer;
import com.dingding.queue.queue.consumer.AppointTaxiOrderConsumer;
import com.dingding.queue.queue.consumer.BusinessConsumer;
import com.dingding.queue.queue.consumer.EmailConsumer;
import com.dingding.queue.queue.consumer.MessageConsumer;
import com.dingding.queue.queue.consumer.PushConsumer;

@Component("intitalConsumer")
public class IntitalConsumer implements InitializingBean {

	private static final Logger log = Logger.getLogger(IntitalConsumer.class);

	@Resource(name = "pushConsumer")
	private PushConsumer pushConsumer;
	@Resource(name = "emailConsumer")
	private EmailConsumer emailConsumer;
	@Resource(name = "messageConsumer")
	private MessageConsumer messageConsumer;
	@Resource(name = "businessConsumer")
	private BusinessConsumer businessConsumer;
	
	@Resource(name = "appointSpecialOrderConsumer")
	private AppointSpecialOrderConsumer appointSpecialOrderConsumer;
	
	@Resource(name = "appointTaxiOrderConsumer")
	private AppointTaxiOrderConsumer appointTaxiOrderConsumer;

	@Override
	public void afterPropertiesSet() throws Exception {

		log.info("正在初始化队列消费者！");

		pushConsumer.intital();
		emailConsumer.intital();
		messageConsumer.intital();
		businessConsumer.intital();
		appointSpecialOrderConsumer.intital();
		appointTaxiOrderConsumer.intital();
		
	}

}
